<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Sets an option for a stream/wrapper/context</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.stream-context-set-default.html">stream_context_set_default</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.stream-context-set-params.html">stream_context_set_params</a></div>
 <div class="up"><a href="ref.stream.html">Stream 函数</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="function.stream-context-set-option" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">stream_context_set_option</h1>
  <p class="verinfo">(PHP 4 &gt;= 4.3.0, PHP 5)</p><p class="refpurpose"><span class="refname">stream_context_set_option</span> &mdash; <span class="dc-title">Sets an option for a stream/wrapper/context</span></p>

 </div>
 
 <div class="refsect1 description" id="refsect1-function.stream-context-set-option-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="type">bool</span> <span class="methodname"><strong>stream_context_set_option</strong></span>
    ( <span class="methodparam"><span class="type">resource</span> <code class="parameter">$stream_or_context</code></span>
   , <span class="methodparam"><span class="type">string</span> <code class="parameter">$wrapper</code></span>
   , <span class="methodparam"><span class="type">string</span> <code class="parameter">$option</code></span>
   , <span class="methodparam"><span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span> <code class="parameter">$value</code></span>
   )</div>

   <div class="methodsynopsis dc-description">
    <span class="type">bool</span> <span class="methodname"><strong>stream_context_set_option</strong></span>
     ( <span class="methodparam"><span class="type">resource</span> <code class="parameter">$stream_or_context</code></span>
    , <span class="methodparam"><span class="type">array</span> <code class="parameter">$options</code></span>
    )</div>

  <p class="simpara">
    Sets an option on the specified context.  <em><code class="parameter">value</code></em>
    is set to <em><code class="parameter">option</code></em> for <em><code class="parameter">wrapper</code></em>
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.stream-context-set-option-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>

    
     <dt>
<em><code class="parameter">stream_or_context</code></em></dt>

     <dd>

      <p class="para">
       The stream or context resource to apply the options to.
      </p>
     </dd>

    
    
     <dt>
<em><code class="parameter">options</code></em></dt>

     <dd>

      <p class="para">
       The options to set for the default context.
      </p>
      <blockquote class="note"><p><strong class="note">Note</strong>: 
       <p class="para">
        <em><code class="parameter">options</code></em> must be an associative
        array of associative arrays in the format
        <em>$arr[&#039;wrapper&#039;][&#039;option&#039;] = $value</em>.
       </p>
       <p class="para">
       Refer to <a href="context.html" class="link">context options and parameters</a>
       for a listing of stream options.
       </p>
      </p></blockquote>
     </dd>

    
   </dl>

  </p>
 </div>

 
 <div class="refsect1 returnvalues" id="refsect1-function.stream-context-set-option-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   成功时返回 <strong><code>TRUE</code></strong>， 或者在失败时返回 <strong><code>FALSE</code></strong>。
  </p>
 </div>


</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.stream-context-set-default.html">stream_context_set_default</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.stream-context-set-params.html">stream_context_set_params</a></div>
 <div class="up"><a href="ref.stream.html">Stream 函数</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
